<?php

namespace app\common\enum;

class LangEnum
{
    const API = 1;//接口

    // 客户端类型
    const ADMIN_PAGE = 2;//后台系统页面

    const APP_PAGE = 3;//APP页面

    /**
     * @notes 获取类型
     * @param bool $value
     * @return string|string[]
     */
    public static function getClientDesc($value = true)
    {
        $data = [
            self::API => '后台接口',
            self::ADMIN_PAGE => '后台系统页面',
            self::APP_PAGE => 'APP页面',
        ];
        if ($value === true) {
            return $data;
        }
        return $data[$value];
    }

    /**
     * @notes 所有选项
     * @return array[]
     */
    public static function getClientOptions()
    {
        return [
            ['label' => 'API接口', 'value' => self::API],
            ['label' => '后台系统页面', 'value' => self::ADMIN_PAGE],
            ['label' => 'APP页面', 'value' => self::APP_PAGE],
        ];
    }

    /**
     * @notes 所有选项
     * @return array[]
     */
    public static function getBuildStaticOption()
    {
        return [
            [
                'label' => 'API接口',
                'value' => self::API,
                'type' => 'php',
                'path'=>'php/resource/translations/'
            ],
            [
                'label' => '后台系统页面',
                'value' => self::ADMIN_PAGE,
                'type' => 'json',
                'path'=>'admin_client/lang/locale/'
            ],
            [
                'label' => 'APP页面',
                'value' => self::APP_PAGE,
                'type' => 'json',
                'path'=>'app_client/lang/locale/'
            ],
        ];
    }

}